home *** CD-ROM | disk | FTP | other *** search
/ Hunter 2006 / Hunter 2006.iso / soft / sleipnir241.exe / {app} / scripts / ƒŠƒ“ƒNˆ— / ‚¿‚傱‚Á‚Æ‹­§ƒŠƒ“ƒN.js next >
Text File  |  2006-06-15  |  8KB  |  206 lines

  1. /*==========================================================
  2. Script by jin-ren
  3. ü@é┐éσé▒é┴é╞ï¡ÉºâèâôâN
  4. ü@Original é┐éσé▒é┴é╞ï¡ÉºâèâôâN ver.1.09ü{â┐
  5.  
  6. ü@êΩăözòzî│üiéΘé─é±é╠é¿òöë«üFhttp://www2s.biglobe.ne.jp/~yanai/üj
  7. ü@Æÿì∞îáü^û╞É╙ü^ô]ì┌é╔è╓é╡é─
  8. ü@û{âXâNâèâvâgé╔è╓é╖éΘâ\âtâgâEâFâAïyé╤âfü[â^é╠Æÿì∞îáé═æSé─üAêΩÄ₧özòzî│é┼éáéΘüA
  9. ü@üuâNâìâmâXüEâNâëâEâôüvé╠è╟ù¥Él"û÷êΣ É¡ÿaühé│é±é╔éáéΦé▄é╖üB
  10. ü@é▒é╠âXâNâèâvâgé═û÷êΣé│é±é╠âIâèâWâiâïé≡î│é╔jin-rené¬SleipnirâAâhâîâXâüâjâàü[ègÆúùpé╔ëⁿò╥é╡é─éáéΦé▄é╖üB
  11. ü@é▒é╠âXâNâèâvâgé╔éµéΘòsï∩ìçôÖé═û÷êΣé│é±ê╢é┼é═é╚é¡üAÄäjin-rené▄é┼é▓ÿAùìë║é│éóüB
  12.  
  13.                                                   2002/09/08
  14. ==========================================================*/
  15.  
  16.     var obj, document, id;
  17.     obj = new ActiveXObject("Sleipnir.API");
  18.     id = obj.GetDocumentID(obj.ActiveIndex);
  19.     obj_doc = obj.GetDocumentObject(id);        // âIâuâWâFâNâgé╠âhâLâàâüâôâg
  20.  
  21.     if (obj_doc == null){
  22.         obj.MessageBox("Document é≡ì∞ɼé┼é½é▄é╣é±");
  23.     } else {
  24.       /***** ò╧Éöé╠Åëè·ë╗ ============================================= *****/
  25.       //
  26.       sel_obj = obj_doc.selection.createRange(); // æIæ≡ö═ê═
  27.  
  28.       /***** ò¬è≥Åêù¥ ================================================ *****/
  29.       //
  30.       type = "all";
  31.       if ( sel_obj == null || sel_obj.htmlText == "" ) {
  32.         /***** æIæ≡ö═ê═é¬é╚éóÅΩìç =============================== *****/
  33.         //
  34.         rep_data = obj_doc.body.innerHTML;  // âyü[âWæSæ╠
  35.         type = "all";
  36.  
  37.       } else {
  38.         /***** æIæ≡ö═ê═é¬éáéΘÅΩìç =============================== *****/
  39.         //
  40.         rep_data = sel_obj.htmlText;  // æIæ≡ö═ê═é╠âeâLâXâgé≡ò\Ī
  41.         type = "sel";
  42.       }
  43.  
  44.       /***** IEâoâOæ╬ì⌠ =============================================== *****/
  45.       //
  46.       re = new RegExp( "<[^>]*><[^>]*>", "ig" );
  47.       target = rep_data.match( re );
  48.       if ( target != null ) {
  49.         if ( target.length == 1 && target[0] == rep_data ) {
  50.           /***** æIæ≡ö═ê═é¬é╚éóüiï≤üjÅΩìç ================= *****/
  51.           //
  52.           rep_data = obj_doc.body.innerHTML;  // âyü[âWæSæ╠
  53.           type = "all";
  54.         }
  55.       }
  56.       rep_data = " " + rep_data;  // Éµô¬æ╬ì⌠
  57.  
  58.       /***** Yahoo!âoâOæ╬ì⌠ =========================================== *****/
  59.       //
  60.       re = new RegExp( "[\?]http://w", "g" );
  61.       rep_data = rep_data.replace( re, "esc_q_h_cw_esc" );
  62.       re = new RegExp( "[\?]http://", "g" );
  63.       rep_data = rep_data.replace( re, "esc_q_h_c_esc" );
  64.  
  65.       re = new RegExp( "=http://w", "g" );
  66.       rep_data = rep_data.replace( re, "esc_e_h_cw_esc" );
  67.       re = new RegExp( "=http://", "g" );
  68.       rep_data = rep_data.replace( re, "esc_e_h_c_esc" );
  69.  
  70.       re = new RegExp( "[\*]http://w", "g" );
  71.       rep_data = rep_data.replace( re, "esc_a_h_cw_esc" );
  72.       re = new RegExp( "[\*]http://", "g" );
  73.       rep_data = rep_data.replace( re, "esc_a_h_c_esc" );
  74.  
  75.       /***** âvâìâgâRâïé╚é╡òΓÉ│ ======================================= *****/
  76.       //
  77.       re = new RegExp( "([^:üF][^/ü^]{1,2})([wéù][wéù][wéù][^.üD]*[.üD][^/ü^]+[/ü^])", "ig" );
  78.       rep_data = rep_data.replace( re, function( str, p1, p2 ){return p1 + "http://" + p2;} );
  79.  
  80.       re = new RegExp( "([^:üF][^/ü^]{1,2})([héê][oéÅ][méì][^.üD]*[.üD][^/ü^]+[/ü^])", "ig" );
  81.       rep_data = rep_data.replace( re, function( str, p1, p2 ){return p1 + "http://" + p2;} );
  82.  
  83.       /***** Æuè╖ÅÇö⌡ ================================================= *****/
  84.       //
  85.       re = new RegExp( "([éO-éÜüD-ü`ü|0-z.-~\-]+)([üF:][ü^/])([éO-éÜüD-ü`ü|0-z.-~\-]+)", "ig" );
  86.       sabun = "éü".charCodeAt(0) - "a".charCodeAt(0);
  87.  
  88.       rng0a = "éO".charCodeAt(0);
  89.       rng0b = "éÜ".charCodeAt(0);
  90.       rng1a = "üD".charCodeAt(0);
  91.       rng1b = "ü`".charCodeAt(0);
  92.       rng2  = "ü|".charCodeAt(0);
  93.  
  94.       rep_data = rep_data.replace( re, function( str, p1, p2, p3 ){
  95.         i_size = p1.length; new_str1 = "";
  96.         for ( i = 0; i < i_size; i ++ ) {
  97.           charc = p1.charCodeAt(i)
  98.           if ( ( rng0a <= charc && charc <= rng0b ) || ( rng1a <= charc && charc <= rng1b ) || ( charc == rng2 ) ) {
  99.             new_str1 += String.fromCharCode( charc - sabun ) ;
  100.           } else {
  101.             new_str1 += String.fromCharCode( charc ) ;
  102.           }
  103.         }
  104.  
  105.         i_size = p3.length; new_str3 = "";
  106.         for ( i = 0; i < i_size; i ++ ) {
  107.           charc = p3.charCodeAt(i)
  108.           if ( ( rng0a <= charc && charc <= rng0b ) || ( rng1a <= charc && charc <= rng1b ) || ( charc == rng2 ) ) {
  109.             new_str3 += String.fromCharCode( charc - sabun ) ;
  110.           } else {
  111.             new_str3 += String.fromCharCode( charc ) ;
  112.           }
  113.         }
  114.         return new_str1 + ":/" + new_str3;
  115.       } );
  116.  
  117.       /***** è╘êßéªâèâôâNæ╬ì⌠ ========================================= *****/
  118.       //
  119.       re = new RegExp( "hp:/", "ig" );
  120.       rep_data = rep_data.replace( re, "http:/" );
  121.  
  122.       re = new RegExp( "htp:/", "ig" );
  123.       rep_data = rep_data.replace( re, "http:/" );
  124.  
  125.       re = new RegExp( "(http:/)([0-z])", "ig" );
  126.       rep_data = rep_data.replace( re, function( str, p1, p2 ){return p1 + "/" + p2;} );
  127.  
  128.       /***** ö╝Æ[âèâôâNæ╬ì⌠ =========================================== *****/
  129.       //
  130.       re = new RegExp( "([^h])(ttp://)", "ig" );
  131.       rep_data = rep_data.replace( re, function( str, p1, p2 ){return p1 + "h" + p2;} );
  132.  
  133.       re = new RegExp( "([^t])(tp://)", "ig" );
  134.       rep_data = rep_data.replace( re, function( str, p1, p2 ){return p1 + "ht" + p2;} );
  135.  
  136.       re = new RegExp( "([^t])(p://)", "ig" );
  137.       rep_data = rep_data.replace( re, function( str, p1, p2 ){return p1 + "htt" + p2;} );
  138.  
  139.       /***** Æuè╖ ===================================================== *****/
  140.       //
  141.       re = new RegExp( "([^\"'=])(http://)([^éƒ-é±â@-âûêƒ-ⁿKüz-üi <\"ü@\n\t\(\)]*)", "ig" );
  142.       rep_data = rep_data.replace( re, function( str, p1, p2, p3 ){
  143.         return ( p1 + '<A href="' + p2 + p3 + '">' + p2 + p3 + '</A>' );
  144.       } );
  145.  
  146.       re = new RegExp( "(<A [^>]*>)(<A [^>]*>)", "ig" );
  147.       rep_data = rep_data.replace( re, function( str, p1, p2 ){ return p1; } );
  148.       re = new RegExp( "</A></A>", "ig" );
  149.       rep_data = rep_data.replace( re, "</A>" );
  150.  
  151.       rep_data = rep_data.substr( 1 );  // Éµô¬æ╬ì⌠
  152.  
  153.       /***** Yahoo!âoâOæ╬ì⌠ =========================================== *****/
  154.       //
  155.       re = new RegExp( "esc_q_h_c_esc", "g" );
  156.       rep_data = rep_data.replace( re, "?http://" );
  157.       re = new RegExp( "esc_q_h_cw_esc", "g" );
  158.       rep_data = rep_data.replace( re, "?http://w" );
  159.  
  160.       re = new RegExp( "esc_e_h_c_esc", "g" );
  161.       rep_data = rep_data.replace( re, "=http://" );
  162.       re = new RegExp( "esc_e_h_cw_esc", "g" );
  163.       rep_data = rep_data.replace( re, "=http://w" );
  164.  
  165.       re = new RegExp( "esc_a_h_c_esc", "g" );
  166.       rep_data = rep_data.replace( re, "*http://" );
  167.       re = new RegExp( "esc_a_h_cw_esc", "g" );
  168.       rep_data = rep_data.replace( re, "*http://w" );
  169.  
  170.       /***** ö╜ëf ===================================================== *****/
  171.       //
  172.       if ( type == "sel" ) {
  173.         /***** æIæ≡ö═ê═é¬éáéΘÅΩìç =============================== *****/
  174.         //
  175.         arr = obj_doc.body.innerHTML.split( sel_obj.htmlText );
  176.         if ( arr.length > 1 ) {
  177.           obj_doc.body.innerHTML = arr.join( rep_data );
  178.         } else {
  179.           dd = new Date();
  180.           dd_str = dd.getTime()
  181.           dd_str = String( dd_str );
  182.  
  183.           new_win = obj.window.open( "", dd_str, "" );
  184.           nd = new_win.document;
  185.           nd.writeln('<META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=Shift_JIS">');
  186.           nd.writeln('<!-- éá(MOJIBAKE TAISAKU) -->');
  187.           nd.writeln('<html><head><title>é┐éσé▒é┴é╞ ï¡ÉºâèâôâN</title>');
  188.           nd.writeln('</head>');
  189.           nd.writeln('<BODY BGCOLOR="white" TEXT="black">');
  190.           nd.writeln('<B>æIæ≡ö═ê═û▀é╡Ä╕ösÄ₧</B><SMALL><BR>üiæIæ≡ö═ê═é╔éµé┴é─é═éñé▄é¡ö╜ëfé┼é½é╕é╔ò╩âEâBâôâhâEò\Īé╞é╚éΦé▄é╖üj<BR>üiò╧è╖é╖éΘæ╬Å█é¬é╚éóÅΩìçéαé▒é╠âEâBâôâhâEé═èJé½é▄é╖üj</SMALL><P>');
  191.           nd.write( rep_data );
  192.           nd.writeln('</BODY></HTML>');
  193.  
  194.         }
  195.  
  196.         obj_doc.selection.empty(); // æIæ≡ë≡Å£
  197.       } else {
  198.         /***** æIæ≡ö═ê═é¬é╚éóÅΩìç =============================== *****/
  199.         //
  200.         obj_doc.body.innerHTML = rep_data;  // âyü[âWæSæ╠
  201.       }
  202.     }
  203.  
  204.     obj.beep();
  205.     obj = null
  206.